﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using Himall.Entity;

namespace Himall.Application.Mappers.Profiles
{
	public class ShopProfile : Profile
	{
		protected override void Configure()
		{
			base.Configure();

			CreateMap<ShopInfo, DTO.Shop>();
			CreateMap<DTO.Shop, ShopInfo>();

			CreateMap<ShopBranchInfo, DTO.ShopBranch>();
			CreateMap<DTO.ShopBranch, ShopBranchInfo>();

			CreateMap<ShopBranchSkusInfo, DTO.ShopBranchSku>();
			CreateMap<DTO.ShopBranchSku, ShopBranchSkusInfo>();

			CreateMap<VShopInfo, DTO.VShop>();
			CreateMap<DTO.VShop, VShopInfo>();

			CreateMap<CustomerServiceInfo, DTO.CustomerService>();
			CreateMap<DTO.CustomerService, CustomerServiceInfo>();

			CreateMap<ShopAccountItemInfo, Himall.DTO.ShopAccountItem>().ForMember(p => p.ShopAccountType, options => options.MapFrom(p => p.TradeType));
			CreateMap<Himall.DTO.ShopAccountItem, ShopAccountItemInfo>().ForMember(p => p.TradeType, options => options.MapFrom(p => p.ShopAccountType));

			CreateMap<ShopAccountInfo, DTO.ShopAccount>();
			CreateMap<DTO.ShopAccount, ShopAccountInfo>();

			CreateMap<ShopBranchManagersInfo, DTO.ShopBranchManager>();
			CreateMap<DTO.ShopBranchManager, ShopBranchManagersInfo>();
		}
	}
}
